import {observable, action} from 'mobx';
import {WeaTableNew} from 'comsMobx';
const {TableStore} = WeaTableNew;
import * as MeetingShareAPI from '../apis/meetingShare';
import {WeaTools} from 'ecCom';

export default class MeetingShare {
    @observable title = '';
    @observable dataKey = '';
    @observable comsWeaTableStore = new TableStore();
    @observable meetingId = '';
    @observable onlyCanView = false;// 该参数目的：在会议监控人员查看会议时，显示会议共享tab，但是没有权限进行编辑
   
    @action doGetShareTable = (meetingid) => {
      MeetingShareAPI.getShareList({ meetingId: meetingid }).then(data => {
        this.comsWeaTableStore.getDatas(data.sessionkey,1);
        this.dataKey = data.sessionkey;
        this.onlyCanView = data.onlyCanView;
      });
    }

    @action doDeleteById = (values,meetingid) => {
      MeetingShareAPI.getDeleteById(values).then((result) => {
        result.status && this.doGetShareTable(meetingid);
      })
    }

}